<?php

declare(strict_types=1);
/**
 * Author: Zane
 * Email: 873934580@qq.com
 * Date: 2023/5/30.
 */

namespace App\Service;

use App\Models\Configure;

class ConfigureService
{
    public function getConfigureCate(): array
    {
        return [];
    }

    /**
     * 存储配置值信息.
     *
     * @param $data
     */
    public function save($data): void
    {
    }

    public static function byNameValue($key, $default = null)
    {
        $dao = Configure::query()->where('name', $key)->first();

        return $dao->value ?? $default;
    }
}
